<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>game</title>
</head>
<body>
    <img id="img" src="./11.jpg" alt="">
    <img id="img-t" src="./22.jpg" alt="">
    <script>
        const img = document.getElementById('img')
        const imgT = document.getElementById('img-t')
        console.log(img);
        window.addEventListener('mousemove', (e) => {
            img.style.left = e.clientX - 110 + 'px';
            img.style.top = e.clientY - 110 + 'px';
            imgT.style.top = e.clientX - 110 + 'px';
            imgT.style.left = e.clientY - 110 + 'px';
            if(img.style.left === imgT.style.left && img.style.top === imgT.style.top ) {
                alert('啊， 被追到了')
            }
        }) 
    </script>
    <style>
        img { 
            transform: scale(0.2);
            position: absolute;
            top: 0;
            left: 0;
        }
        img-t { 
            position: absolute;
            top: 0;
            left: 0;
        }
    </style>
</body>
</html>